<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/myblog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/myblog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/myblog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/myblog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/myblog/css/main.css">


<link rel="stylesheet" href="/myblog/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/myblog/lib/pace/pace-theme-minimal.min.css">
  <script src="/myblog/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gao-qianwei.gitee.io","root":"/myblog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="coalesce、substring、concat、select null 与 select + 1、sql关键字执行顺序">
<meta property="og:type" content="article">
<meta property="og:title" content="SQL笔记（一）">
<meta property="og:url" content="https://gao-qianwei.gitee.io/myblog/2021/09/30/SQL%EF%BC%9A%E7%AC%94%E8%AE%B0%EF%BC%88%E4%B8%80%EF%BC%89/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="coalesce、substring、concat、select null 与 select + 1、sql关键字执行顺序">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-09-30T14:58:37.811Z">
<meta property="article:modified_time" content="2021-09-30T15:40:45.892Z">
<meta property="article:author" content="高乾威">
<meta property="article:tag" content="数据研发">
<meta property="article:tag" content="SQL">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://gao-qianwei.gitee.io/myblog/2021/09/30/SQL%EF%BC%9A%E7%AC%94%E8%AE%B0%EF%BC%88%E4%B8%80%EF%BC%89/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>SQL笔记（一） | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/myblog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/myblog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/myblog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/myblog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/myblog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/myblog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-links">

    <a href="/myblog/links/" rel="section"><i class="fa fa-link fa-fw"></i>友链</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gao-qianwei.gitee.io/myblog/2021/09/30/SQL%EF%BC%9A%E7%AC%94%E8%AE%B0%EF%BC%88%E4%B8%80%EF%BC%89/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/myblog/images/avatar.png">
      <meta itemprop="name" content="高乾威">
      <meta itemprop="description" content="报我楼成秋望月，把君诗读夜回灯">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          SQL笔记（一）
        </h1>

        <div class="post-meta">

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-09-30 22:58:37 / 修改时间：23:40:45" itemprop="dateCreated datePublished" datetime="2021-09-30T22:58:37+08:00">2021-09-30</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/" itemprop="url" rel="index"><span itemprop="name">数据研发</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/SQL/" itemprop="url" rel="index"><span itemprop="name">SQL</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <span class="post-meta-divider">|</span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>coalesce、substring、concat、select null 与 select + 1、sql关键字执行顺序</p>
<span id="more"></span>

<h3 id="coalesce"><a href="#coalesce" class="headerlink" title="coalesce"></a>coalesce</h3><p>​        一个非常有用的函数：coalesce。特别是在做统计的时候，这个函数作为条件可以兼顾到一些特殊情况。这里做一下总结和分享。</p>
<p>用途：</p>
<p>（1）将控制替换成其他值；</p>
<p>（2）返回第一个非空值</p>
<p>表达式：<br>        COALESCE是一个函数， (expression_1, expression_2, …,expression_n)依次参考各参数表达式，遇到非null值即停止并返回该值。如果所有的表达式都是空值，最终将返回一个空值。使用COALESCE在于大部分包含空值的表达式最终将返回空值。</p>
<p>SQL实例</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">select</span> <span class="built_in">coalesce</span>(success_cnt, <span class="number">1</span>) <span class="keyword">from</span> tableA</span><br></pre></td></tr></table></figure>

<p>当success_cnt 为null值的时候，将返回1，否则将返回success_cnt的真实值。</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">select</span> <span class="built_in">coalesce</span>(success_cnt,<span class="keyword">period</span>,<span class="number">1</span>) <span class="keyword">from</span> tableA</span><br></pre></td></tr></table></figure>

<p>当success_cnt不为null，那么无论period是否为null，都将返回success_cnt的真实值（因为success_cnt是第一个参数），当success_cnt为null，而period不为null的时候，返回period的真实值。只有当success_cnt和period均为null的时候，将返回1。</p>
<h3 id="substring"><a href="#substring" class="headerlink" title="substring"></a>substring</h3><p>SUBSTRING(name, -4，2) 截取name这个字段的第 4 个字符位置（倒数）开始取，只截取之后的2个字符</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> <span class="built_in">SUBSTRING</span>(<span class="string">&#x27;成都融资事业部&#x27;</span>, <span class="number">-4</span>, <span class="number">2</span>)</span><br></pre></td></tr></table></figure>

<p>结果：资事</p>
<p>注意：我们注意到在函数 substring(str,pos, len)中， pos 可以是负值（表示倒数），但 len 不能取负值。</p>
<h3 id="concat"><a href="#concat" class="headerlink" title="concat"></a>concat</h3><p>SQL CONCAT函数用于连接两个字符串，形成一个字符串。试试下面的例子：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">SQL&gt; SELECT CONCAT(&#39;FIRST &#39;, &#39;SECOND&#39;);</span><br><span class="line">+----------------------------+</span><br><span class="line">| CONCAT(&#39;FIRST &#39;, &#39;SECOND&#39;) |</span><br><span class="line">+----------------------------+</span><br><span class="line">| FIRST SECOND               |</span><br><span class="line">+----------------------------+</span><br><span class="line">1 row in set (0.00 sec)</span><br></pre></td></tr></table></figure>

<p>​    要了解更加详细concat函数，考虑一个employee_tbl表，其具有以下记录：    </p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">SQL&gt; SELECT * FROM employee_tbl;</span><br><span class="line">+------+------+------------+--------------------+</span><br><span class="line">| id   | name | work_date  | daily_typing_pages |</span><br><span class="line">+------+------+------------+--------------------+</span><br><span class="line">|    1 | John | 2007-01-24 |                250 |</span><br><span class="line">|    2 | Ram  | 2007-05-27 |                220 |</span><br><span class="line">|    3 | Jack | 2007-05-06 |                170 |</span><br><span class="line">|    3 | Jack | 2007-04-06 |                100 |</span><br><span class="line">|    4 | Jill | 2007-04-06 |                220 |</span><br><span class="line">|    5 | Zara | 2007-06-06 |                300 |</span><br><span class="line">|    5 | Zara | 2007-02-06 |                350 |</span><br><span class="line">+------+------+------------+--------------------+</span><br><span class="line">7 rows <span class="keyword">in</span> <span class="built_in">set</span> (0.00 sec)</span><br></pre></td></tr></table></figure>

<p>​    现在假设的基础上要连接所有的名字：员工ID和work_date在上述表中，那么你可以使用以下命令做到这一点：</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">SQL&gt; SELECT CONCAT(id, name, work_date)</span><br><span class="line">    -&gt; FROM employee_tbl;</span><br><span class="line">+-----------------------------+</span><br><span class="line">| CONCAT(id, name, work_date) |</span><br><span class="line">+-----------------------------+</span><br><span class="line">| 1John2007-01-24             |</span><br><span class="line">| 2Ram2007-05-27              |</span><br><span class="line">| 3Jack2007-05-06             |</span><br><span class="line">| 3Jack2007-04-06             |</span><br><span class="line">| 4Jill2007-04-06             |</span><br><span class="line">| 5Zara2007-06-06             |</span><br><span class="line">| 5Zara2007-02-06             |</span><br><span class="line">+-----------------------------+</span><br><span class="line">7 rows <span class="keyword">in</span> <span class="built_in">set</span> (0.00 sec)</span><br></pre></td></tr></table></figure>



<h3 id="select-null-与-select-1"><a href="#select-null-与-select-1" class="headerlink" title="select null 与 select + 1"></a>select null 与 select + 1</h3><p><a target="_blank" rel="noopener" href="https://lewky.blog.csdn.net/article/details/78290971">SQL笔记-select 1与select null</a></p>
<p>如果表里有记录，select 1语句就会返回相应的记录行数的结果集，并且列名为1，每一行的值也都是1。这里的1并不是指的第一个字段，它可以替换成任意的常量，此时返回的列名和值都是该常量。</p>
<blockquote>
<p>可以用来查询表中是否有符合条件的记录(比如<code>select 1 from seckill where id = 1001;</code>)，select 1一般用来当作条件使用，比如exists( select 1 from 表名)等。select 1的效率比<code>select 列名</code>和<code>select*</code>快，因为不用查字典表。</p>
</blockquote>
<p>select 1可以使用count()、sum()函数，count()对select 1返回的行数进行了计数，所以没有记录行的test表返回的是0；而有4条记录行的表则返回了4。如果把select count(1)改成select count(2)，也只会改变结果集里的列名（从count(1)变成count(2)）。</p>
<p>和之前使用select 1一样，从效率上看，select count(1) &gt; select count(列名) &gt; select count(*)。</p>
<p>select null 和select 1类似，只是返回的列名和值变成了NULL；不过不同的是，select null 不可以配合使用count()和sum()函数。</p>
<p>注：</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> <span class="keyword">NULL</span> <span class="operator">+</span> <span class="number">1</span></span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果为 NULL</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="关键字执行顺序"><a href="#关键字执行顺序" class="headerlink" title="关键字执行顺序"></a>关键字执行顺序</h3><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/u013887008/article/details/93377939"> sql语句执行顺序</a></p>
<p>1、查询中用到的关键词主要包含六个，并且他们的顺序依次为 </p>
<p>　　<strong>select –&gt; from –&gt; where –&gt; group by –&gt; having –&gt; order by</strong> </p>
<p>　　其中<strong>select</strong>和<strong>from</strong>是必须的，其他关键词是可选的</p>
<p> 2、六个关键词的执行顺序是：</p>
<p>　　<strong>from –&gt; where –&gt; group by –&gt; having –&gt; select –&gt; order by</strong></p>
<p>　　from: 需要从哪个数据表检索数据 。</p>
<p>　　where: 过滤表中数据的条件。</p>
<p>　　group by: 如何将上面过滤出的数据分组。</p>
<p>　　having: 对上面已经分组的数据进行过滤的条件。</p>
<p>　　select: 查看结果集中的哪个列，或列的计算结果。</p>
<p>　　order by: 按照什么样的顺序来查看返回的数据。</p>
<p> 3、使用注意：</p>
<p>　　①、from后面的表关联，是自<strong>右向左解析</strong>的，而where条件的解析顺序是<strong>自下而上</strong>的。 也就是说，在写SQL的时候，尽量把<strong>数据量小的表放在最右边来进行关联</strong>（用小表去匹配大表）；而把<strong>能筛选出小量数据的条件放在where语句的最左边</strong> （用小表去匹配大表）。</p>
<p>　　②、使用count（列名）当某列出现null值的时候，count（*）仍然会计算，但是count(列名)不会。</p>
<p>　　③、<strong>group by：</strong>select 列a,聚合函数（聚合函数规范） from 表明 where 过滤条件 group by 列a </p>
<p>　　　　　group by 子句也和where条件语句结合在一起使用。当结合在一起时，where在前，group by在后。即先对select xx from xx的记录集合用where进行筛选，然后再使用group by对筛选后的结果进行分组。</p>
<p>　　④、<strong>having：</strong>having条件表达式，但是需要注意having和where的用法区别：</p>
<p>　　　　<strong>i.</strong> having只能用在group by之后，对分组后的结果进行筛选(即使用having的前提条件是分组)。 </p>
<p>　　　　<strong>ii.</strong> where肯定在group by之前，即也在having之前。</p>
<p>　　　　<strong>iii.</strong> where后的条件表达式里不允许使用聚合函数，而having可以。</p>
<p>　　⑤、当一个查询语句同时出现了where, group by, having, order by的时候，执行顺序和编写顺序是： </p>
<p>　　　　<strong>i.</strong> 执行where xx对全表数据做筛选，返回第1个结果集。</p>
<p>　　　　<strong>ii.</strong> 针对第1个结果集使用group by分组，返回第2个结果集。</p>
<p>　　　　<strong>iii.</strong> 针对第2个结集执行having xx进行筛选，返回第3个结果集。</p>
<p>　　　　<strong>iv.</strong> 针对第3个结果集中的每1组数据执行select xx，有几组就执行几次，返回第4个结果集。</p>
<p>　　　　<strong>v.</strong> 针对第4个结果集排序。</p>
<p>参考：</p>
<p><a target="_blank" rel="noopener" href="https://www.huaweicloud.com/articles/57d6f18ec6aec181dd2d6f62a48c27a4.html">Mysql中concat()、concat_ws()和 group_concat()的用法 - 华为云 (huaweicloud.com)</a></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/myblog/tags/%E6%95%B0%E6%8D%AE%E7%A0%94%E5%8F%91/" rel="tag"># 数据研发</a>
              <a href="/myblog/tags/SQL/" rel="tag"># SQL</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/myblog/2021/06/14/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%EF%BC%9A%E5%B9%B6%E6%9F%A5%E9%9B%86/" rel="prev" title="并查集">
      <i class="fa fa-chevron-left"></i> 并查集
    </a></div>
      <div class="post-nav-item">
    <a href="/myblog/2021/09/30/%E6%95%B0%E6%8D%AE%E4%BB%93%E5%BA%93%EF%BC%9A%E5%88%86%E5%B1%82/" rel="next" title="数据仓库分层">
      数据仓库分层 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#coalesce"><span class="nav-text">coalesce</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#substring"><span class="nav-text">substring</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#concat"><span class="nav-text">concat</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#select-null-%E4%B8%8E-select-1"><span class="nav-text">select null 与 select + 1</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%B3%E9%94%AE%E5%AD%97%E6%89%A7%E8%A1%8C%E9%A1%BA%E5%BA%8F"><span class="nav-text">关键字执行顺序</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="高乾威"
      src="/myblog/images/avatar.png">
  <p class="site-author-name" itemprop="name">高乾威</p>
  <div class="site-description" itemprop="description">报我楼成秋望月，把君诗读夜回灯</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/myblog/archives/">
        
          <span class="site-state-item-count">91</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/myblog/categories/">
          
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/myblog/tags/">
          
        <span class="site-state-item-count">59</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="http://github.com/GaoQianwei" title="GitHub → http:&#x2F;&#x2F;github.com&#x2F;GaoQianwei" rel="noopener" target="_blank">GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:2966807184@qq.com" title="E-Mail → mailto:2966807184@qq.com" rel="noopener" target="_blank">E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/xue-wu-zhi-jing-75-22" title="知乎 → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;xue-wu-zhi-jing-75-22" rel="noopener" target="_blank">知乎</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/weixin_45341339" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;weixin_45341339" rel="noopener" target="_blank">CSDN</a>
      </span>
  </div>



      </div><div>
  <canvas id="canvasDiyBlock" style="width:60%;">当前浏览器不支持canvas，请更换浏览器后再试</canvas>
<script src="/myblog/js/custom/clock.js"></script>

</div>


    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2021-04 到 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">高乾威</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

<span class="post-meta-divider">|</span>

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">全站共 117.2k 字</span>
</div>

<span class="post-meta-divider">|</span>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/myblog/lib/anime.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.ui.min.js"></script>

<script src="/myblog/js/utils.js"></script>

<script src="/myblog/js/motion.js"></script>


<script src="/myblog/js/schemes/pisces.js"></script>


<script src="/myblog/js/next-boot.js"></script>


  <script defer src="/myblog/lib/three/three.min.js"></script>
    <script defer src="/myblog/lib/three/canvas_lines.min.js"></script>


  




  
<script src="/myblog/js/local-search.js"></script>













  

  

</body>
</html>
